layui.form.verify({
    pwd:[/^\S{6,12}$/,'密码长度必须在6到12位'],
    repwd:function(value){
        var pwd = $('[name="newPwd"]').val();
        if(pwd != value){
            return '密码不一致';
        }
    }
})


//实现密码重置功能
$('#myform').submit(function(e){
    e.preventDefault();
    $.ajax({
        method:'post',
        url:'/my/updatepwd',
        data:$('#myform').serialize(),
        success:function(res){
            // console.log(res);
            localStorage.removeItem('token');
            //iframe找外面的页面
            window.parent.location.href = '/login.html'
        }
    })
})